<?php
namespace app\index\controller;

use think\Controller;
use think\facade\Request;

class Index extends Controller
{
    //局部注册拦截器
//    protected $middleware = [
//        'CheckLogin'
//    ];

    public function index(Request $request)
    {
        //echo "<pre>";
        //var_dump($request);

        //throw new Exception("aaa");
        echo "name: ".$request->name."<br>";
        return "Index11";
    }

    public function test()
    {

        //报错
        //$request = \think\Request::instance();
        //var_dump($request);

        $request = request();
        echo '<pre>';
        var_dump($request);

        return "test";
    }


}
